package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.Client;

public class BankService {

	public static void addClient(Bank bank, Client client) {
		bank.addClient(client);
	}
	
	public static void modifyBank(Bank bank, Client client, int amount) {
		client.getAccount().deposit(amount);
	}
	
	public static void printBalance(Bank bank) {
		for (Client client : bank.getClients()) {
			System.out.println( client.getAccount().getBalance() );
		}
	}
	
//	public static void printBalance(Bank bank) {
//		for (int i = 0; i < bank.getClients().length; i++) {
//			System.out.println(bank.getClients()[i].getClientSalutation() + " client N" + (i+1) + " " + 
//					bank.getClients()[i].getAccount().getBalance() );
//		}
//	}
	
	public static void printMaximumAmountToWithdraw(Bank bank) {
		for (Client client : bank.getClients()) {
			System.out.println( client.getAccount().maximumAmountToWithdraw() );
		}
	}
}
